<template>
    <n-empty :show-description="false">
        <template #icon>
            <n-icon></n-icon>
        </template>
    </n-empty>
</template>
<script lang="tsx">
import { defineComponent, onBeforeMount } from "vue";
import { useRoute, useRouter } from "vue-router";

export default defineComponent({
    name: "Redirect",
    setup() {
        const route = useRoute();
        const router = useRouter();
        onBeforeMount(() => {
            // 当前路由
            const { params, query } = route;
            const { path } = params;
            router.replace({
                path: "/" + (Array.isArray(path) ? path.join("/") : path),
                query,
            });
        });
        return {}
    }
})
</script>